package com.Drools.CIPS.controller;

import com.Drools.CIPS.bean.DroolsReturn;
import com.Drools.CIPS.ruler.XlsxRuler;
import com.Drools.CIPS.ruler.Xlsx_MTRuler;
import com.Drools.CIPS.util.MTToSwiftMessage;
import com.Drools.CIPS.util.XmlToMap;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RequestMapping("/drools")
@RestController
public class Xlsx_MTController {
    @Resource
    Xlsx_MTRuler xlsx_mtRuler;

    @RequestMapping("/xlsx_MT")//放入  xml文件和xlsx文件进行规则校验
    public DroolsReturn AllDrools(@RequestBody Map<String,Object> map){

        System.out.println("--------------");
        return xlsx_mtRuler.XlsxRuler(
                map.get("pathXlsx").toString(),//xlsx物理位置
                MTToSwiftMessage.swift(map.get("pathMT").toString()/*MT物理位置*/)
        );
    }
}
